feat(test-consume): initial implementation of the enginex simulator#1964
Open
danceratopz wants to merge 5 commits intoethereum:forks/amsterdamfrom
Open
feat(test-consume): initial implementation of the enginex simulator#1964danceratopz wants to merge 5 commits intoethereum:forks/amsterdamfrom
danceratopz wants to merge 5 commits intoethereum:forks/amsterdamfrom
Conversation
pytest-xdist is supported, but not optimised.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## forks/amsterdam #1964 +/- ##
================================================
Coverage 86.33% 86.33%
================================================
Files 538 538
Lines 34557 34557
Branches 3222 3222
================================================
Hits 29835 29835
Misses 4148 4148
Partials 574 574
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Carsons-Eels
pushed a commit
to Carsons-Eels/execution-specs
that referenced
this pull request
Jan 6, 2026
* chore(fw): remove fill warnings. * chore(fw): refactor.
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🗒️ Description
Adds a
consume enginexsimulator that reuses client instances across tests sharing the same pre-allocation state. This simulator significantly reduces test execution time compared toconsume engineby avoiding per-test client startup overhead.Includes basic
pytest-xdistsupport via--dist=loadgroup, with further optimizations planned in subsequent PRs.Architecture
The
enginexsimulator groups tests bypre_hash(hash of genesis + pre-state). Tests in the same group run against a single client instance instead of starting/stopping per test.New Files
simulators/enginex/conftest.pysimulators/multi_test_client.pyMultiTestClientManagerfor client lifecyclesimulators/helpers/test_tracker.pyModified
consume.pyxdist_groupmarker based onpre_hashfor enginex fixturestest_via_engine.pyengineandenginexmodespytest_hive.pyshared_hive_testfixture for cross-test client sharingprocessors.py--dist=loadgroupdefault for enginex with xdistExecution Flow
pytest_collection_modifyitemscounts tests per group, sorts bypre_hash.mark_test_completedtriggers client shutdown.Fixture Chain
flowchart LR subgraph "Per Group (cached)" PAG[pre_alloc_group] --> CG[client_genesis] PAG --> GH[genesis_header] CG --> BG[buffered_genesis] BG --> CF[client_files] end subgraph "Client (reused)" CF --> C[client] C --> ETH[eth_rpc] C --> ENG[engine_rpc] end subgraph "Per Test" TC[test_case] --> F[fixture] F --> P[payloads] end subgraph "Test Execution" GH --> TEST[test_blockchain_via_engine] ENG --> TEST P --> TEST endTesting
For testing, use this custom release which keeps tests marked as
@pytest.mark.slowin the same pre-alloc group as their non-slow counterparts (greatly reduces the number of groups):https://github.com/danceratopz/execution-specs/releases/tag/v0.1.0a1
🔗 Related Issues or PRs
N/A.
✅ Checklist
toxchecks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:uvx tox -e statictype(scope):.[ ] All: Considered adding an entry to CHANGELOG.md.skippedCute Animal Picture